home *** CD-ROM | disk | FTP | other *** search
- @if-using not(ocl-file-buff-chg)
- @use (ocl-file-buff-chg)
- ;OCL{{{}}}
- ;OCL{{{ reference description
- @if-using ( FUN-REFERENCE ) ; 1 ;
- Define functions, for moving the cursor between multiple buffers on the
- screen.
- @fi
- ;OCL}}}
- ;OCL{{{ local vars
- ( defvar ( x-cur y-cur b ) )
- ;OCL}}}
- ;OCL{{{ go-offset-buffer
- ( deffun ( x-off y-off ) go-offset-buffer
- ( if >(used-buffers 1)
- ;OCL{{{ search for other buffer in given direction
- (
- ;OCL{{{ init position
- set x-cur store-pos
- if >(x-cur screen-width) ( set x-cur screen-width ) fi
- set x-cur +(x-cur screen-width-offset x-off)
- set y-cur +(screen-height-offset y-off cursor-level)
- ;OCL}}}
- ;OCL{{{ while in current buffer, skipt position
- while
- pre
- ( set b buffer-from-position x-cur y-cur )
- =(b current-buffer-number)
- ;OCL{{{ one step to border
- ( set x-cur +(x-cur x-off)
- set y-cur +(y-cur y-off)
- )
- ;OCL}}}
- ;OCL}}}
- ;OCL{{{ maybe got buffer and return
- if <>(b 0) ( goto-buffer-number b return-from-macro ) fi
- ;OCL}}}
- )
- ;OCL}}}
- fi
- message ( M_NO_BUFFERS )
- )
- )
- ;OCL}}}
- ;OCL{{{ up-buffer
- ;OCL{{{ reference
- @if-using ( FUN-REFERENCE ) ; 2 ; up-buffer-ref
- ;OCL{{{ up-buffer
- Move the cursor to the buffer above the cursor.
- ;OCL}}}
- @fi
- ;OCL}}}
- ( deffun up-buffer ( go-offset-buffer ( 0 -1 ) ) )
- ;OCL}}}
- ;OCL{{{ down-buffer
- ;OCL{{{ reference
- @if-using ( FUN-REFERENCE ) ; 2 ; down-buffer-ref
- ;OCL{{{ down-buffer
- Move the cursor to the buffer below the cursor.
- ;OCL}}}
- @fi
- ;OCL}}}
- ( deffun down-buffer ( go-offset-buffer ( 0 1 ) ) )
- ;OCL}}}
- ;OCL{{{ left-buffer
- ;OCL{{{ reference
- @if-using ( FUN-REFERENCE ) ; 2 ; left-buffer-ref
- ;OCL{{{ left-buffer
- Move the cursor to the buffer to the left of the cursor.
- ;OCL}}}
- @fi
- ;OCL}}}
- ( deffun left-buffer ( go-offset-buffer ( -1 0 ) ) )
- ;OCL}}}
- ;OCL{{{ right-buffer
- ;OCL{{{ reference
- @if-using ( FUN-REFERENCE ) ; 2 ; right-buffer-ref
- ;OCL{{{ right-buffer
- Move the cursor to the buffer to the right of the cursor.
- ;OCL}}}
- @fi
- ;OCL}}}
- ( deffun right-buffer ( go-offset-buffer ( 1 0 ) ) )
- ;OCL}}}
- ;OCL{{{ previous-buffer
- ;OCL{{{ reference
- @if-using ( FUN-REFERENCE ) ; 2 ; previous-buffer-ref
- ;OCL{{{ previous-buffer
- Switch to the previous buffer.
- ;OCL}}}
- @fi
- ;OCL}}}
- ( deffun previous-buffer ( goto-buffer-number -(current-buffer-number 1) ) )
- ;OCL}}}
- ;OCL{{{ next-buffer
- ;OCL{{{ reference
- @if-using ( FUN-REFERENCE ) ; 2 ; next-buffer-ref
- ;OCL{{{ next-buffer
- Switch to the next buffer.
- ;OCL}}}
- @fi
- ;OCL}}}
- ( deffun next-buffer ( goto-buffer-number +(current-buffer-number 1) ) )
- ;OCL}}}
- ;OCL{{{ undelcare vars and internal func
- ( undeclare ( go-offset-buffer x-cur y-cur b ) )
- ;OCL}}}
- @fi
-